//
//  CFigureLayer.m
//  FavDraw
//
//  Created by lang honglin on 11-2-25.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "CFigureLayer.h"
#import "CLine.h"



@implementation CFigureLayer

@synthesize layerName;


-(CFigureLayer*)initWithName:(NSString*)Name {
	
	if (self = [super init] ) {
		self.layerName = Name;
		figureArray = [[NSMutableArray alloc] init ];
	}
	return self;
	
}

-(void)AddFigure:(CFigure*)figureObj {
	
	[figureArray addObject:figureObj];
}

-(void)AddFigureObj:(ShapeType)shapetype ObjBoundRect:(CGRect)boundRect {
	
	CLine*  line;
	switch (shapetype) {
		case kLineShape:
			line = [CLine alloc];
			line.objBoundRect = boundRect;
			NSLog(@"Layer AddFigureObj");
			break;
		case kRectShape:
			break;
		case kEllipseShape:
			break;
		case kImageShape: {
			break;			
		}
		default:
			break;
	}
	
}

- (void)dealloc {
    [super dealloc];
	[figureArray release];
}


@end
